import service from "@/utils/request";
const DEPT_BASE_URL = "/api/";
import { startQuert } from "../EarTagManagement/model";
import { purcoreQuery, buildingIdQuery } from "../PurchaseMent/model";
//羊只采购
class purcure{
  //获取数据
static getList(queryParams?: purcoreQuery) {
    return service<any, purcoreQuery>({
      url: `${DEPT_BASE_URL}PurchaseFormModel/GetPurchaseForms`,
      method: "post",
      data: queryParams,
    });
}
  //删除
  static deletes(ids: number[]) {
    return service<any, number[]>({
      url: `/api/PurchaseFormModel/DelPurchaseForms`,
      method: "post",
      data:ids
    });
  }
  //获取栋舍
  static getrid(queryParams?: buildingIdQuery) {
  return service<any, buildingIdQuery>({
      url: `${DEPT_BASE_URL}Ridgepoles/GetShow`,
      method: "get",
      data: queryParams,
  })
  }
  //添加羊只采购
  static addrid(data: any[]) {
    debugger
    return service({
      url: `/api/PurchaseFormModel/AddPurchaseForms`,
      method: "post",
      data
    });
  }
  //摘要
  static getAbstract() {
    return service({
      url: `${DEPT_BASE_URL}PurchaseFormModel/GetSummaryEnum`,
      method: "get",
    });
  }
  //获取栏位
  static getcolumn(ridgepoleId:any) {
    return service({
      url: `${DEPT_BASE_URL}ColumnManages/GetColumn`,
      method: "get",
      params: {
        ridgepoleId:ridgepoleId
      }
    });
  }
  //获取品种
  static getbreed() {
    return service({
      url: `/api/EarTage/ShowEarTageBreed`,
      method: "get",
    });
  
  }
  //获取耳号
  static getSheepNo(queryParams?: startQuert) {
    return service<any, startQuert>({
      url: `/api/EarTage/GetShow`,
      method: "get",
      params: queryParams,
    });
  }
  //反填
  static update(purchaseFormId: any) {
    return service({
      url: `${DEPT_BASE_URL}PurchaseFormModel/Purchaseformmodel`,
      method: "get",
      params: {
        purchaseFormId: purchaseFormId
      }
    })
  }
  //修改
  static updatePurchaseForm(data: any) {
    return service({
      url: `${DEPT_BASE_URL}PurchaseFormModel/UpdatePurchaseformmodel`,
      method: "put",
      data
    })
  }
  //未使用的耳标
  static getNoUseSheepNo() {
    return service({
      url: `${DEPT_BASE_URL}EarTage/ShowStateEartag`,
      method: "get",
    });
  
  }
}

export default purcure;